package com.example.easybuy.service.impl;

import com.example.easybuy.mapper.EasybuyNewsMapper;
import com.example.easybuy.mapper.EasybuyProductCategoryMapper;
import com.example.easybuy.pojo.EasybuyProductCategory;
import com.example.easybuy.service.EasybuyProductCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author 张子晨
 * @since 2021-03-12
 */
@Service
public class EasybuyProductCategoryServiceImpl implements EasybuyProductCategoryService {

    @Autowired
    private EasybuyProductCategoryMapper easybuyProductCategoryMapper;

    //查询所有商品分类
    @Override
    public List<EasybuyProductCategory> allProductCategory() {
        return easybuyProductCategoryMapper.allProductCategory();
    }

    //根据categoryLevel1Id获取对应级别的名字(不为0)
    @Override
    public EasybuyProductCategory getProductByLevelId(Integer id) {
        return easybuyProductCategoryMapper.getProductByLevelId(id);
    }
}
